<body>
<style>
    html, body {
        background-color: #FFF !important;
    }

    .modal-body {
        background-color: #fff;
        padding: 15px
    }

    .page-header {
        margin-top: 15px !important;
    }

    .geographic input {
        width: 100px !important;
        float: left;
        margin-right: 15px;
    }
    .new-content{padding:15px 0px}
    .config_img{width:45px;height:45px;margin-top:15px;}
</style>

<div class="modal-body">


    <div class="modal-header">

        <div class="assistant_header">
            <button type="button" class="close" data-dismiss="modal" close="true">
                <span aria-hidden="true">×</span>
            </button>
            <h4 class="modal-title">
                <span class="fa fa-legal"></span>&nbsp;添加设备
            </h4>
        </div>
    </div>

    <div class="new-content">
        <form name="add_form" class="form-horizontal layui-form">


            <div class="form-group">
                <label class="col-sm-3 control-label">*设备序列号:</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" name="deviceSerial" placeholder="设备序列号">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">*二维码设备:</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" name="qrcodeSerial" placeholder="二维码设备序列号">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">*验证码:</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" name="validateCode" placeholder="验证码">
                </div>
            </div>


        </form>

    </div>
    <div class="assistant_button" >
        <button type="button" class="layui-btn layui-btn-primary js_quit" close="true">取消</button>
        <!--        <button type="button" class="btn btn-primary btn-sm js_add" _event="add" data-id="0" data-name="">保存</button>-->
        <button type="button" class="layui-btn js_add" >保存</button>
    </div>

</div>



<script>
    var newModal = new yii.modal();
    layui.use(['form', 'layedit', 'tree', 'util','laydate'], function () {
        var form = layui.form
            , layer = layui.layer;

        $(".js_add").click(function () {
            var data = $("form[name='add_form']").serializeArray();
            $.ajax({
                type: 'post',
                url: "{:URL('tickets/checked/doDevice')}",
                data: data,
                dataType: 'JSON',
                success: function (res) {
                    window.location.href = "{:URL('tickets/checked/index')}";
                    // if (res.code != 0) {
                    //     layer.alert(res.msg);
                    // } else {
                    //
                    // }
                },
                error: function (res) {
                }
            });
        })

        layui.form.render('select');
        form.render();
    });
</script>

</body>
</html>